package com.jeff.work;

import java.time.LocalDateTime;

public class MyProcess {
    /**
     * 进程名字
     */
    String name;
    /**
     * 优先级
     */
    int priority;
    /**
     * 到达时间
     */
    int arrivalTime;

    LocalDateTime startTime;

    LocalDateTime finishTime;
    /**
     * 需要运行时间
     */
    int burstTime;
    /**
     * 剩余时间
     */
    int remainingTime;
    /**
     * 已用时间
     */
    int usedTime;
    /**
     * 等待时间
     */
    int waitingTime;
    /**
     * 状态
     */
    String status;

    /**
     * 构造函数
     * @param name 进程名字
     * @param priority 优先级
     * @param arrivalTime 到达时间
     * @param burstTime 需要运行时间
     */
    public MyProcess(String name, int priority, int arrivalTime, int burstTime, int usedTime) {
        this.name = name;
        this.priority = priority;
        this.arrivalTime = arrivalTime;
        this.burstTime = burstTime;
        this.usedTime = usedTime;
        this.remainingTime = burstTime - usedTime;
        this.waitingTime = 0;
        this.status = "wait";
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getPriority() {
        return priority;
    }

    public void setPriority(int priority) {
        this.priority = priority;
    }

    public int getArrivalTime() {
        return arrivalTime;
    }

    public void setArrivalTime(int arrivalTime) {
        this.arrivalTime = arrivalTime;
    }

    public int getBurstTime() {
        return burstTime;
    }

    public void setBurstTime(int burstTime) {
        this.burstTime = burstTime;
    }

    public int getRemainingTime() {
        return remainingTime;
    }

    public void setRemainingTime(int remainingTime) {
        this.remainingTime = remainingTime;
    }

    public int getUsedTime() {
        return usedTime;
    }

    public void setUsedTime(int usedTime) {
        this.usedTime = usedTime;
    }

    public int getWaitingTime() {
        return waitingTime;
    }

    public void setWaitingTime(int waitingTime) {
        this.waitingTime = waitingTime;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public LocalDateTime getStartTime() {
        return startTime;
    }

    public void setStartTime(LocalDateTime startTime) {
        this.startTime = startTime;
    }

    public LocalDateTime getFinishTime() {
        return finishTime;
    }

    public void setFinishTime(LocalDateTime finishTime) {
        this.finishTime = finishTime;
    }
}